/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vista.informes;

import controlador.informes.GestorInformesGenerales;
import controlador.reportes.GestorReportesCompras;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import org.hibernate.HibernateException;
import util.FechaUtil;
import util.NTupla;
import util.Tupla;
import vista.reportes.sources.InformeComprasPorMes;

/**
 *
 * @author Administrador
 */
public class EmitirInformesGenerales extends javax.swing.JInternalFrame {

    private static final int INFORME_GANANCIAS_EMPRESA = 0;
    private static final int INFORME_COTIZACIONES_RECHAZADAS = 1;
    private static final int INFORME_LISTADO_PROVEEDORES_MAS_SOLICITADOS = 2;
    private static final int INFORME_OBRAS_POR_YEAR = 3;
    private static final int INFORME_CONTROL_OBRAS = 4;
    private static final int INFORME_BENEFICIOS_OBRAS = 5;
    private static final int INFORME_CARGAHORARIA_EMPLEADOS = 6;
    private static final int INFORME_COMPRAS_POR_MES = 7;
    GestorInformesGenerales _gestor;
    
    /**
     * Creates new form EmitirInformesGenerales
     */
    public EmitirInformesGenerales() {
        initComponents();
        grupoFiltroProveedor.add(filtroProveedorPorCantidad);
        grupoFiltroProveedor.add(filtroProveedorPorMonto);
        grupoFiltroProducto.add(filtroProductoPorCantidad);
        grupoFiltroProducto.add(filtroProductoPorMonto);
        filtroProveedorPorCantidad.setSelected(true);
        filtroProductoPorCantidad.setSelected(true);
        spinnerProdXProv.setValue(3);
        initFiltros();
        pb.setVisible(false);
        _gestor = new GestorInformesGenerales(filtroFechaInicio.getDate(),filtroFechaFin.getDate());
        mostrarClientes();
        mostrarEmpleados();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        grupoFiltroProveedor = new javax.swing.ButtonGroup();
        grupoFiltroProducto = new javax.swing.ButtonGroup();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel2 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        btnEmitirGanancias = new javax.swing.JButton();
        jLabel14 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        txtHistoricoGanancias = new javax.swing.JFormattedTextField();
        jPanel8 = new javax.swing.JPanel();
        btnEmitirCotizacionesRechazadas = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        txtHistoricoCotRech = new javax.swing.JFormattedTextField();
        jPanel14 = new javax.swing.JPanel();
        btnObrasPorYear = new javax.swing.JButton();
        jLabel18 = new javax.swing.JLabel();
        jPanel15 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        txtHistoricoObrasPorYear = new javax.swing.JFormattedTextField();
        jPanel19 = new javax.swing.JPanel();
        btnObrasPorYear1 = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        jPanel20 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        cboClientesInformeBeneficios = new javax.swing.JComboBox();
        jPanel3 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        btnEmitirGanancias1 = new javax.swing.JButton();
        jLabel15 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        filtroProveedorPorCantidad = new javax.swing.JRadioButton();
        filtroProveedorPorMonto = new javax.swing.JRadioButton();
        jLabel5 = new javax.swing.JLabel();
        filtroProductoPorCantidad = new javax.swing.JRadioButton();
        filtroProductoPorMonto = new javax.swing.JRadioButton();
        jLabel6 = new javax.swing.JLabel();
        spinnerProdXProv = new javax.swing.JSpinner();
        jPanel24 = new javax.swing.JPanel();
        btnEmitirComprasPorMes = new javax.swing.JButton();
        jLabel24 = new javax.swing.JLabel();
        jPanel13 = new javax.swing.JPanel();
        jPanel16 = new javax.swing.JPanel();
        btnEmitirGanancias3 = new javax.swing.JButton();
        jLabel19 = new javax.swing.JLabel();
        jPanel17 = new javax.swing.JPanel();
        chkSoloFinalizadas = new javax.swing.JCheckBox();
        jPanel10 = new javax.swing.JPanel();
        jPanel22 = new javax.swing.JPanel();
        btnEmitirHorasEmpleado = new javax.swing.JButton();
        jLabel22 = new javax.swing.JLabel();
        jPanel23 = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        cmbEmpleados = new javax.swing.JComboBox();
        btnCerrar = new javax.swing.JButton();
        pb = new javax.swing.JProgressBar();
        jPanel5 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        filtroFechaInicio = new com.toedter.calendar.JDateChooser();
        jLabel2 = new javax.swing.JLabel();
        filtroFechaFin = new com.toedter.calendar.JDateChooser();

        setIconifiable(true);
        setTitle("Informes");

        jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Montos Cotizados VS Montos Ejecutados"));

        btnEmitirGanancias.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/iconos/var/16x16/print.png"))); // NOI18N
        btnEmitirGanancias.setText("Emitir");
        btnEmitirGanancias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEmitirGananciasActionPerformed(evt);
            }
        });

        jLabel14.setText("<HTML>Ingresos de la empresa por obras concluidas en el rango de tiempo seleccionado.");

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Filtros Particulares:")));

        jLabel8.setText("Cantidad de años a considerar en el Historico (Hasta la Fecha De Fin):");

        txtHistoricoGanancias.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        txtHistoricoGanancias.setText("5");
        txtHistoricoGanancias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtHistoricoGananciasActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtHistoricoGanancias, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel8)
                .addComponent(txtHistoricoGanancias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, 411, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnEmitirGanancias))
            .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnEmitirGanancias, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Cotizaciones Rechazadas por los clientes"));

        btnEmitirCotizacionesRechazadas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/iconos/var/16x16/print.png"))); // NOI18N
        btnEmitirCotizacionesRechazadas.setText("Emitir");
        btnEmitirCotizacionesRechazadas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEmitirCotizacionesRechazadasActionPerformed(evt);
            }
        });

        jLabel16.setText("<HTML>Informes sobre la cantidad de  Cotizaciones que fueron Rechazadas por un cliente.");

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Filtros Particulares:")));

        jLabel7.setText("Cantidad de años a considerar en el Historico (Hasta la Fecha De Fin):");

        txtHistoricoCotRech.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        txtHistoricoCotRech.setText("5");
        txtHistoricoCotRech.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtHistoricoCotRechActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtHistoricoCotRech, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel7)
                .addComponent(txtHistoricoCotRech, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnEmitirCotizacionesRechazadas))
                    .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnEmitirCotizacionesRechazadas)
                    .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder("Cantidad de Obras Tomadas por año"));

        btnObrasPorYear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/iconos/var/16x16/print.png"))); // NOI18N
        btnObrasPorYear.setText("Emitir");
        btnObrasPorYear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnObrasPorYearActionPerformed(evt);
            }
        });

        jLabel18.setText("<HTML>Cantidad de Obras terminadas por año.");

        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Filtros Particulares:")));

        jLabel10.setText("Cantidad de años a considerar en el Historico (Hasta la Fecha De Fin):");

        txtHistoricoObrasPorYear.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        txtHistoricoObrasPorYear.setText("5");
        txtHistoricoObrasPorYear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtHistoricoObrasPorYearActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, 365, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtHistoricoObrasPorYear, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel10)
                .addComponent(txtHistoricoObrasPorYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnObrasPorYear))
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(2, 2, 2))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnObrasPorYear)
                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel19.setBorder(javax.swing.BorderFactory.createTitledBorder("Beneficios de cotizaciones según aceptación"));

        btnObrasPorYear1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/iconos/var/16x16/print.png"))); // NOI18N
        btnObrasPorYear1.setText("Emitir");
        btnObrasPorYear1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnObrasPorYear1ActionPerformed(evt);
            }
        });

        jLabel21.setText("<HTML>Promedio y rango maximo y minimo de ganancias por cotizaciones </br>históricas, clasificados según si las cotizaciones fueron rechazadas o aceptadas");

        jPanel20.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Filtros Particulares:")));

        jLabel11.setText("Clientes:");

        cboClientesInformeBeneficios.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cboClientesInformeBeneficios, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel11)
                .addComponent(cboClientesInformeBeneficios, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel19Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnObrasPorYear1))
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(2, 2, 2))
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnObrasPorYear1)
                    .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(108, Short.MAX_VALUE))
        );

        jScrollPane1.setViewportView(jPanel2);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 545, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("<HTML><b>Informes Generales</b>", jPanel1);

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Listado de Proveedores"));

        btnEmitirGanancias1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/iconos/var/16x16/print.png"))); // NOI18N
        btnEmitirGanancias1.setText("Emitir");
        btnEmitirGanancias1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEmitirGanancias1ActionPerformed(evt);
            }
        });

        jLabel15.setText("<HTML>Listado de los Proveedores de los cuales se recibió más cantidad  de productos o se pagó más en el periodo de tiempo seleccionado. Se incluye un listado de los productos más solicitados pudiendo determinar la cantidad a mostrar de los mismos por proveedor.");

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Filtros Particulares:")));

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel3.setText("Ordenar Proveedores por:");

        filtroProveedorPorCantidad.setText("Cantidad");

        filtroProveedorPorMonto.setText("Monto");

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel5.setText("Ordenar Productos por:");

        filtroProductoPorCantidad.setText("Cantidad");

        filtroProductoPorMonto.setText("Monto");

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel6.setText("Cantidad De Productos Por Proveedor:");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(filtroProveedorPorCantidad)
                            .addComponent(filtroProductoPorCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(filtroProveedorPorMonto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(filtroProductoPorMonto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(spinnerProdXProv)))
                .addContainerGap(160, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(filtroProveedorPorCantidad)
                    .addComponent(filtroProveedorPorMonto))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(filtroProductoPorCantidad)
                    .addComponent(filtroProductoPorMonto))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(spinnerProdXProv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel15, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnEmitirGanancias1)))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnEmitirGanancias1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel24.setBorder(javax.swing.BorderFactory.createTitledBorder("Compras Mensuales"));

        btnEmitirComprasPorMes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/iconos/var/16x16/print.png"))); // NOI18N
        btnEmitirComprasPorMes.setText("Emitir");
        btnEmitirComprasPorMes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEmitirComprasPorMesActionPerformed(evt);
            }
        });

        jLabel24.setText("<HTML><BODY>El informe muestra una serie de gráficos con las compras realizadas durante el periodo seleccionado, discriminando luego de un cálculo de compras mensuales totales a cada uno de los recursos.");

        javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24);
        jPanel24.setLayout(jPanel24Layout);
        jPanel24Layout.setHorizontalGroup(
            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel24Layout.createSequentialGroup()
                .addComponent(jLabel24, javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnEmitirComprasPorMes))
        );
        jPanel24Layout.setVerticalGroup(
            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel24Layout.createSequentialGroup()
                .addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnEmitirComprasPorMes)
                    .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel24, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel24, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(229, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Compras", jPanel3);

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder("Informes para control de las Obras"));

        btnEmitirGanancias3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/iconos/var/16x16/print.png"))); // NOI18N
        btnEmitirGanancias3.setText("Emitir");
        btnEmitirGanancias3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEmitirGanancias3ActionPerformed(evt);
            }
        });

        jLabel19.setText("<HTML>El siguiente informe muestra un acumulado de usos de Recursos comparandolos entre las 3 etapas principales de la obra <i>Cotización, Planificación y Ejecución</i>");

        jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Filtros Particulares:")));

        chkSoloFinalizadas.setSelected(true);
        chkSoloFinalizadas.setText("<HTML><b>Únicamente</b> considerar obras <b>Finalizadas</b>.");

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(chkSoloFinalizadas)
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addComponent(chkSoloFinalizadas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel16Layout.createSequentialGroup()
                        .addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnEmitirGanancias3))
                    .addComponent(jPanel17, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnEmitirGanancias3)
                    .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(405, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("De las Obras", jPanel13);

        jPanel22.setBorder(javax.swing.BorderFactory.createTitledBorder("Horas asignadas a empleados por mes"));

        btnEmitirHorasEmpleado.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/iconos/var/16x16/print.png"))); // NOI18N
        btnEmitirHorasEmpleado.setText("Emitir");
        btnEmitirHorasEmpleado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEmitirHorasEmpleadoActionPerformed(evt);
            }
        });

        jLabel22.setText("<HTML><BODY>El informe analiza mes por mes, la carga horaria por mes de los empleados que se encuentran asignados a las obras.");

        jPanel23.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Filtros Particulares:")));

        jLabel23.setText("Empleados:");

        javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23);
        jPanel23.setLayout(jPanel23Layout);
        jPanel23Layout.setHorizontalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel23Layout.createSequentialGroup()
                .addComponent(jLabel23)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cmbEmpleados, 0, 190, Short.MAX_VALUE)
                .addGap(247, 247, 247))
        );
        jPanel23Layout.setVerticalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel23)
                .addComponent(cmbEmpleados, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
        jPanel22.setLayout(jPanel22Layout);
        jPanel22Layout.setHorizontalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnEmitirHorasEmpleado))
            .addComponent(jPanel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel22Layout.setVerticalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnEmitirHorasEmpleado)
                    .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jPanel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jPanel22, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 432, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Recursos Humanos", jPanel10);

        btnCerrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/iconos/var/16x16/block.png"))); // NOI18N
        btnCerrar.setText("Cerrar");
        btnCerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCerrarActionPerformed(evt);
            }
        });

        pb.setIndeterminate(true);
        pb.setString("Generando el Informe (Por favor Aguarde) ...");
        pb.setStringPainted(true);

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtros Generales:"));

        jLabel1.setText("Fecha de Inicio:");

        jLabel2.setText("Fecha de Fin:");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(filtroFechaInicio, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(filtroFechaFin, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(filtroFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(filtroFechaFin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pb, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTabbedPane1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnCerrar, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTabbedPane1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnCerrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pb, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed
        this.dispose();
    }//GEN-LAST:event_btnCerrarActionPerformed

    private void btnEmitirGanancias1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEmitirGanancias1ActionPerformed
        emitirInforme(INFORME_LISTADO_PROVEEDORES_MAS_SOLICITADOS);
    }//GEN-LAST:event_btnEmitirGanancias1ActionPerformed

    private void btnEmitirGananciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEmitirGananciasActionPerformed
        emitirInforme(INFORME_GANANCIAS_EMPRESA);
    }//GEN-LAST:event_btnEmitirGananciasActionPerformed

    private void btnEmitirCotizacionesRechazadasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEmitirCotizacionesRechazadasActionPerformed
        emitirInforme(INFORME_COTIZACIONES_RECHAZADAS);
    }//GEN-LAST:event_btnEmitirCotizacionesRechazadasActionPerformed

    private void txtHistoricoCotRechActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtHistoricoCotRechActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtHistoricoCotRechActionPerformed

    private void txtHistoricoGananciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtHistoricoGananciasActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtHistoricoGananciasActionPerformed

    private void btnObrasPorYearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnObrasPorYearActionPerformed
        emitirInforme(INFORME_OBRAS_POR_YEAR);
    }//GEN-LAST:event_btnObrasPorYearActionPerformed

    private void txtHistoricoObrasPorYearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtHistoricoObrasPorYearActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtHistoricoObrasPorYearActionPerformed

    private void btnEmitirGanancias3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEmitirGanancias3ActionPerformed
        emitirInforme(INFORME_CONTROL_OBRAS);
    }//GEN-LAST:event_btnEmitirGanancias3ActionPerformed

    private void btnObrasPorYear1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnObrasPorYear1ActionPerformed
         emitirInforme(INFORME_BENEFICIOS_OBRAS);
    }//GEN-LAST:event_btnObrasPorYear1ActionPerformed

    private void btnEmitirHorasEmpleadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEmitirHorasEmpleadoActionPerformed
        emitirInforme(INFORME_CARGAHORARIA_EMPLEADOS);
    }//GEN-LAST:event_btnEmitirHorasEmpleadoActionPerformed

    private void btnEmitirComprasPorMesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEmitirComprasPorMesActionPerformed
        emitirInforme(INFORME_COMPRAS_POR_MES);
    }//GEN-LAST:event_btnEmitirComprasPorMesActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCerrar;
    private javax.swing.JButton btnEmitirComprasPorMes;
    private javax.swing.JButton btnEmitirCotizacionesRechazadas;
    private javax.swing.JButton btnEmitirGanancias;
    private javax.swing.JButton btnEmitirGanancias1;
    private javax.swing.JButton btnEmitirGanancias3;
    private javax.swing.JButton btnEmitirHorasEmpleado;
    private javax.swing.JButton btnObrasPorYear;
    private javax.swing.JButton btnObrasPorYear1;
    private javax.swing.JComboBox cboClientesInformeBeneficios;
    private javax.swing.JCheckBox chkSoloFinalizadas;
    private javax.swing.JComboBox cmbEmpleados;
    private com.toedter.calendar.JDateChooser filtroFechaFin;
    private com.toedter.calendar.JDateChooser filtroFechaInicio;
    private javax.swing.JRadioButton filtroProductoPorCantidad;
    private javax.swing.JRadioButton filtroProductoPorMonto;
    private javax.swing.JRadioButton filtroProveedorPorCantidad;
    private javax.swing.JRadioButton filtroProveedorPorMonto;
    private javax.swing.ButtonGroup grupoFiltroProducto;
    private javax.swing.ButtonGroup grupoFiltroProveedor;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel23;
    private javax.swing.JPanel jPanel24;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JProgressBar pb;
    private javax.swing.JSpinner spinnerProdXProv;
    private javax.swing.JFormattedTextField txtHistoricoCotRech;
    private javax.swing.JFormattedTextField txtHistoricoGanancias;
    private javax.swing.JFormattedTextField txtHistoricoObrasPorYear;
    // End of variables declaration//GEN-END:variables

    private void emitirInforme(int informe) {
        
        // Valido los filtros Generales
        if(!validarFiltros()){ return; }
        
        // Inicio el Reporte
        prepararEmision();
        
        // Atencion, lanzar todos los informes como Threads
            switch(informe){
                // ============================================================
                case INFORME_GANANCIAS_EMPRESA:
                        Thread thread = new Thread(new Runnable() {
                            @Override
                            public void run() {
                                try{

                                    Integer anios = 5;
                                    if(!txtHistoricoGanancias.getText().isEmpty()){
                                        anios = Integer.valueOf(txtHistoricoGanancias.getText());
                                        if(anios<0){
                                            anios = 0;
                                        }
                                    }
                                    
                                    GestorInformesGenerales gestor = new GestorInformesGenerales(filtroFechaInicio.getDate(),filtroFechaFin.getDate());
                                    gestor.generarInformeGanancias(anios);
                                    concluirEmision(JOptionPane.INFORMATION_MESSAGE,"<HTML>Se concluyo con <b>éxito</b> la generación del Informe");
                                }catch(Exception e){
                                    System.err.println("ERROR:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><b>Error al generar el informe:</b>\n"+e.getMessage());
                                }
                            }
                        });
                        thread.start();
                    break;
                // ============================================================
                case INFORME_COTIZACIONES_RECHAZADAS:
                        Thread thread2 = new Thread(new Runnable() {
                            @Override
                            public void run() {
                                try{
                                    Integer anios = 5;
                                    if(!txtHistoricoCotRech.getText().isEmpty()){
                                        anios = Integer.valueOf(txtHistoricoCotRech.getText());
                                        if(anios<0){
                                            anios = 0;
                                        }
                                    }
                                    
                                    GestorInformesGenerales gestor = new GestorInformesGenerales(filtroFechaInicio.getDate(),filtroFechaFin.getDate());
                                    gestor.generarInformeCantidadCotizacionesRechazadas(anios);
                                    concluirEmision(JOptionPane.INFORMATION_MESSAGE,"<HTML>Se concluyo con <b>éxito</b> la generación del Informe");
                                }catch(Exception e){
                                    System.err.println("ERROR:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><b>Error al generar el informe:</b>\n"+e.getMessage());
                                }
                            }
                        });
                        thread2.start();
                    break; 
                // ============================================================
                case INFORME_BENEFICIOS_OBRAS:
                        Thread thread6 = new Thread(new Runnable() {
                            @Override
                            public void run() {
                                try{
                                    NTupla cli = (NTupla)cboClientesInformeBeneficios.getSelectedItem();
                                    GestorInformesGenerales gestor = new GestorInformesGenerales(filtroFechaInicio.getDate(),filtroFechaFin.getDate());
                                    gestor.generarInformePorcentajeDeBeneficiosSegunAceptacionDeCotizacion(cli);
                                    concluirEmision(JOptionPane.INFORMATION_MESSAGE,"<HTML>Se concluyo con <b>éxito</b> la generación del Informe");
                                }catch(Exception e){
                                    System.err.println("ERROR:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><b>Error al generar el informe:</b>\n"+e.getMessage());
                                }
                            }
                        });
                        thread6.start();
                    break;                    
                 // ============================================================  
                 case INFORME_LISTADO_PROVEEDORES_MAS_SOLICITADOS:
                        Thread thread3 = new Thread(new Runnable() {
                            @Override
                            public void run() {
                                try{
                                    String filtroProveedor;
                                    if(filtroProveedorPorCantidad.isSelected()) {
                                        filtroProveedor = "Por Cantidad";
                                    }
                                    else {
                                        filtroProveedor = "Por Monto";
                                    }
                                    
                                    String filtroProducto;
                                    if(filtroProveedorPorCantidad.isSelected()) {
                                        filtroProducto = "Por Cantidad";
                                    }
                                    else {
                                        filtroProducto = "Por Monto";
                                    }
                                    
                                    GestorReportesCompras gestor = new GestorReportesCompras();
                                    gestor.emitirListadoProveedoresMasSolicitados(filtroFechaInicio.getDate(),
                                            filtroFechaFin.getDate(),
                                            filtroProveedor,
                                            filtroProducto,
                                            (Integer)spinnerProdXProv.getValue());
                                    concluirEmision(JOptionPane.INFORMATION_MESSAGE,"<HTML>Se concluyo con <b>éxito</b> la generación del Informe");
                                }catch(Exception e){
                                    System.err.println("ERROR:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><b>Error al generar el informe:</b>\n"+e.getMessage());
                                }
                            }
                        });
                        thread3.start();
                    break;    
                // ============================================================
                case INFORME_OBRAS_POR_YEAR:
                        Thread thread4 = new Thread(new Runnable() {
                            @Override
                            public void run() {
                                try{

                                    Integer anios = 5;
                                    if(!txtHistoricoObrasPorYear.getText().isEmpty()){
                                        anios = Integer.valueOf(txtHistoricoObrasPorYear.getText());
                                        if(anios<0){
                                            anios = 0;
                                        }
                                    }
                                    
                                    GestorInformesGenerales gestor = new GestorInformesGenerales(filtroFechaInicio.getDate(),filtroFechaFin.getDate());
                                    gestor.generarInformeObrasPorYear(anios);
                                    concluirEmision(JOptionPane.INFORMATION_MESSAGE,"<HTML>Se concluyo con <b>éxito</b> la generación del Informe");
                                }catch(Exception e){
                                    System.err.println("ERROR:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><b>Error al generar el informe:</b>\n"+e.getMessage());
                                }
                            }
                        });
                        thread4.start();
                    break;       
                // ============================================================
                case INFORME_CONTROL_OBRAS:
                        Thread thread5 = new Thread(new Runnable() {
                            @Override
                            public void run() {
                                try{

                                    Integer anios = 5;
                                    if(!txtHistoricoObrasPorYear.getText().isEmpty()){
                                        anios = Integer.valueOf(txtHistoricoObrasPorYear.getText());
                                        if(anios<0){
                                            anios = 0;
                                        }
                                    }
                                    
                                    GestorInformesGenerales gestor = new GestorInformesGenerales(filtroFechaInicio.getDate(),filtroFechaFin.getDate());
                                    gestor.generarInformeControlObras(anios,chkSoloFinalizadas.isSelected());
                                    concluirEmision(JOptionPane.INFORMATION_MESSAGE,"<HTML>Se concluyo con <b>éxito</b> la generación del Informe");
                                }catch(Exception e){
                                    System.err.println("ERROR:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><b>Error al generar el informe:</b>\n"+e.getMessage());
                                }
                            }
                        });
                        thread5.start();
                    break;                       
                    
                case INFORME_CARGAHORARIA_EMPLEADOS:
                        Thread thread7 = new Thread(new Runnable() {
                            @Override
                            public void run() {
                                try{

                                    NTupla tEmpleado = (NTupla)cmbEmpleados.getSelectedItem();
                                    
                                    GestorInformesGenerales gestor = new GestorInformesGenerales(filtroFechaInicio.getDate(),filtroFechaFin.getDate());
                                    gestor.generarInformeCargaHorariaEmpleados(tEmpleado.getId());
                                    concluirEmision(JOptionPane.INFORMATION_MESSAGE,"<HTML>Se concluyo con <b>éxito</b> la generación del Informe");
                                
                                }catch(HibernateException e){   
                                    System.err.println("ERROR HIBERNATE:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><BODY><b>Error al generar el informe. "
                                                                                + "Contacte al administrador</b>\n");
                                }catch(Exception e){
                                    System.err.println("ERROR:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><b>Error al generar el informe:</b>\n"+e.getMessage());
                                }
                            }
                        });
                        thread7.start();
                    break;   
                    
                    case INFORME_COMPRAS_POR_MES:
                        Thread thread8 = new Thread(new Runnable() {
                            @Override
                            public void run() {
                                try{
                                    
                                    GestorInformesGenerales gestor = new GestorInformesGenerales(filtroFechaInicio.getDate(),filtroFechaFin.getDate());
                                    gestor.generarInformeComprasPorMes();
                                    concluirEmision(JOptionPane.INFORMATION_MESSAGE,"<HTML>Se concluyo con <b>éxito</b> la generación del Informe");
                                
                                }catch(HibernateException e){   
                                    System.err.println("ERROR HIBERNATE:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><BODY><b>Error al generar el informe. "
                                                                                + "Contacte al administrador</b>\n");
                                }catch(Exception e){
                                    System.err.println("ERROR:" + e.getMessage());
                                    concluirEmision(JOptionPane.ERROR_MESSAGE,"<HTML><b>Error al generar el informe:</b>\n"+e.getMessage());
                                }
                            }
                        });
                        thread8.start();
                    break;   
            }
        
    }

    protected void prepararEmision() {
        pb.setVisible(true);
        bloquearOtrosInformes(true);
    }
    
    protected void concluirEmision(int tipoMensaje,String mensaje) {
        pb.setVisible(false);
        bloquearOtrosInformes(false);
        mostrarMensaje(tipoMensaje,"Atencion!", mensaje);
    }    

    private void initFiltros() {
        initFiltrosGananciasEmpresa();
    }

    private void initFiltrosGananciasEmpresa() {
        
        Date inicio = new Date();
        inicio.setMonth(Calendar.JANUARY);
        inicio.setDate(1);
        inicio.setYear(inicio.getYear()-5);
        Date fin = new Date();
        fin.setMonth(Calendar.DECEMBER);
        fin.setDate(31);
        
        filtroFechaInicio.setDate(inicio);
        filtroFechaFin.setDate(fin);
    }
    
    /**
     * Muestra un mensaje
     * @param tipo
     * @param titulo
     * @param mensaje 
     */
    public void mostrarMensaje(int tipo,String titulo,String mensaje)
    {
         JOptionPane.showMessageDialog(this.getParent(),mensaje,titulo,tipo);
    }    

    private void bloquearOtrosInformes(boolean bloquear) {
        btnEmitirGanancias.setEnabled(!bloquear);
        filtroFechaInicio.setEnabled(!bloquear);
        filtroFechaFin.setEnabled(!bloquear);
    }

    private boolean validarFiltros() {
        
        boolean res = true;
        StringBuilder msg = new StringBuilder("<HTML>");
        
        if(filtroFechaInicio.getDate()==null){
            msg.append("- Ingrese en los filtros una <b>Fecha de Inicio</b><br>");
            res = false;
        }
        
        if(filtroFechaFin.getDate()==null){
            msg.append("- Ingrese en los filtros una <b>Fecha de Fin</b><br>");
            res = false;
        }
        
        if(filtroFechaFin.getDate()!=null && filtroFechaInicio.getDate()!=null){
            if(FechaUtil.fechaMayorQue(filtroFechaInicio.getDate(),filtroFechaFin.getDate())){
                msg.append("- La Fecha de Inicio no puede ser Mayor a la Fecha de Fin<br>");
                res = false;   
            }
        }
        
        if(!res){
            mostrarMensaje(JOptionPane.ERROR_MESSAGE,"Error!",msg.toString());
        }
        
        return res;
    }
    private void mostrarClientes()
    {
        
        DefaultComboBoxModel valores = new DefaultComboBoxModel();
        
        NTupla tuplaTodos = new NTupla(0);
        tuplaTodos.setNombre("Todas");
        valores.addElement(tuplaTodos);
        List<NTupla> lista = new ArrayList<NTupla>();
        try{
            lista = _gestor.mostrarClientes();
        } catch(Exception e){
            mostrarMensaje(JOptionPane.ERROR_MESSAGE,"Error!","Ocurrio un error cargando el listado de empresas cliente");
        }
        Iterator<NTupla> it = lista.iterator();
        while(it.hasNext()){
            NTupla tu = it.next();
            valores.addElement(tu);
        }
        cboClientesInformeBeneficios.setModel(valores);

    }
    
    private void mostrarEmpleados()
    {
        DefaultComboBoxModel valores = new DefaultComboBoxModel();
        
        NTupla tuplaTodos = new NTupla(0);
        tuplaTodos.setNombre("Todos");
        valores.addElement(tuplaTodos);
        List<NTupla> lista = new ArrayList<NTupla>();
        try{
            lista = _gestor.mostrarEmpleados();
        } catch(Exception e){
            mostrarMensaje(JOptionPane.ERROR_MESSAGE,"Error!","Ocurrio un error cargando el listado de empleados");
        }
        Iterator<NTupla> it = lista.iterator();
        while(it.hasNext()){
            NTupla tu = it.next();
            valores.addElement(tu);
        }
        cmbEmpleados.setModel(valores);
    }
}
